﻿using ELearningSystem.Gateway.Entities;
using FluentNHibernate.Mapping;

namespace ELearningSystem.Gateway.Mappings
{
    public class TreeContentMap : ClassMap<TreeContent>
    {
        public TreeContentMap()
        {
            Id(x => x.Id);
            References(x => x.Content)
                .Not.LazyLoad()
                .Cascade.All();
            
            References(x => x.ParentNode)
                .Not.LazyLoad()
                .Cascade.All();
            Map(x => x.Position);
            Map(x => x.Text);
        }
    }
}
